<template>
    <div>你喜欢跑步🏃‍吗</div>
    <!-- <el-input :value="search" @input="inputHandle($event)"></el-input> -->
    <input type="text" :value="search" @input="inputHandle($event)" />
    <el-button @click="myEvenet">我喜欢跑步</el-button>
</template>

<script lang="ts" >
import { ref, reactive, defineComponent } from "vue";

export default {
    data() {
        return {};
    },
    emits: ["myEvent", "update:search"],
    props: ["search"],
    setup(props, { attrs, slots, emit }) {
        return {};
    },
    created() {},
    mounted() {},
    methods: {
        myEvenet() {
            console.log("子组件触发", this.search);

            this.$emit("myEvent");
        },
        inputHandle(event) {
            console.log("子组件input", event.target.value);
            this.$emit("update:search", event.target.value);
        },
    },
};
</script>

<style lang="less" scoped>
</style>